﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;

namespace l1cs.server.serverpackets
{
    public class S_Trap : ServerBasePacket
    {
        public S_Trap( L1TrapInstance trap, String name )
        {
            writeC( Opcodes.S_OPCODE_DROPITEM );
            writeH( trap.getX() );
            writeH( trap.getY() );
            writeD( trap.getId() );
            writeH( 7 ); // adena
            writeC( 0 );
            writeC( 0 );
            writeC( 0 );
            writeC( 0 );
            writeD( 0 );
            writeC( 0 );
            writeC( 0 );
            writeS( name );
            writeC( 0 );
            writeD( 0 );
            writeD( 0 );
            writeC( 255 );
            writeC( 0 );
            writeC( 0 );
            writeC( 0 );
            writeH( 65535 );
            // writeD(0x401799a);
            writeD( 0 );
            writeC( 8 );
            writeC( 0 );
        }

        override
        public byte[] getContent()
        {
            return getBytes();
        }

        override
        public String getType()
        {
            return "[S] S_Trap";
        }
    }
}